-
Notifications
You must be signed in to change notification settings - Fork 214
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: local-orch-account
.transfer()
supports pfm routes
#10571
Conversation
Deploying agoric-sdk with Cloudflare Pages
|
d6db026
to
2fa2f75
Compare
c111b13
to
05dd05c
Compare
Base branch is changed to master. Please re-run the integration tests by adding 'force:integration' label. |
05dd05c
to
310a176
Compare
5977597
to
9c0a243
Compare
af67a1f
to
e6de422
Compare
e6de422
to
81d1df5
Compare
81d1df5
to
6c5db7f
Compare
This is now dependent on #10588. As of writing I see green minus some seemingly unrelated inter integration tests. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks pretty good
If any of my comments turn out to be important, I'm confident that we can address them in due course.
), | ||
const { forwardOpts, ...rest } = opts ?? {}; | ||
|
||
// throws if route is not determinable |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hoist that to a @throws
on the transfer
method?
@@ -686,12 +682,16 @@ export const prepareLocalOrchestrationAccountKit = ( | |||
transfer(destination, amount, opts) { | |||
return asVow(() => { | |||
trace('Transferring funds from LCA over IBC'); | |||
const denomAmount = coerceDenomAmount(chainHub, amount); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can throw, right? Add a @throws
in the transfer
docstring in orchestration-api.ts
?
I see TODO document the mapping from the address to the destination chain.
Is it time to document that now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated here and orchestration-api.ts
{ message: /connection not found: agoric-3<->fakenet/ }, | ||
{ message: 'no connection info found for "agoric-3_fakenet"' }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I kinda like <->
. I wonder why it went away.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Restored
* @returns {[string, DenomDetail & { brandKey?: string }]} | ||
* @returns {[string, DenomDetail]} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👏
assetOn('ubld', 'agoric', bldSansMint.brand), | ||
assetOn('uist', 'agoric', istSansMint.brand), | ||
assetOn('uusdc', 'noble', undefined, 'agoric', chainInfoWithCaps), | ||
assetOn('uatom', 'cosmoshub', undefined, 'agoric', chainInfoWithCaps), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no ATOM brand? that's a little odd.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't have one created in test support yet. I guess no tests currently call for it.
console.warn( | ||
'⚠️ `amountToCoin` not working until #10449; use `DenomAmount` for now', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hm. "death before confusion" suggests throwing here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated to throw here. Had to refactor the staking-combinations
example contract a bit as a result
@@ -67,6 +71,13 @@ const contract = async ( | |||
|
|||
const creatorFacet = prepareChainHubAdmin(zone, chainHub); | |||
|
|||
registerChainsAndAssets( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thinking about the way each "feat" shows up in release notes, I wonder if "feat: auto-stake-it provides its own chain, connection, asset info" would make a better commit message.
Or, since auto-stake-it is more of an example than an orch API product feature, call it a chore.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good feedback, updated
'--assetInfo', | ||
JSON.stringify([ | ||
[ | ||
'uist', | ||
{ | ||
baseDenom: 'uist', | ||
baseName: 'agoric', | ||
chainName: 'agoric', | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no IST brand. hm. I guess this test doesn't need it?
toExternalConfig
would work nicely here instead of JSON.stringify
. Just like...
options: toExternalConfig(config, crossVatContext, FastUSDCConfigShape), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
toExternalConfig would work nicely here instead of JSON.stringify. Just like...
Agree, but I did not tackle this here. Something to improve in the future.
startUpgradable, | ||
}, | ||
installation: { | ||
// @ts-expect-error not a WellKnownName |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
elsewhere we refine the powers
type to tell callers what's really expected
@@ -652,17 +656,24 @@ const makeCustomer = ( | |||
{ amount: String(toReceive.value), denom: uusdcOnAgoric }, | |||
'C4', | |||
); | |||
|
|||
t.log(who, 'sees', ibcTransferMsg.token, 'sent to', EUD); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
any particular reason to get rid of this t.log()
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, restored
c12d868
to
aa03864
Compare
Base branch is changed to master. Please re-run the integration tests by adding 'force:integration' label. |
@mergify refresh |
✅ Pull request refreshed |
a1132f4
to
a706d28
Compare
@mergify queue |
✅ The pull request has been merged automaticallyThe pull request has been merged automatically at 9b8cad2 |
- shape used for pfm ForwardInfo options
- provide `chainInfo` and `assetInfo` in commonPrivateArgs for contracts to use - register common assets used in testing - provide `populateChainHub` function for use in exo unit testing in favor of `registerAgoricBld`
this test can no longer rely on the IST brand being available, so we - added checks to ensure brands are accepted for `.transfer` and `.send`. marked as failing for now - filed #10449 since this surfaced a bug in `amountToCoin` - use Moolah issuer for "no denom for brand" failure path tests
- enables sending offers with brands
- chainInfo and assetInfo are provided as `commonPrivateArgs`. include them in `ContractMeta`
- auto-stake-it initializes `chainHub` with data so existing tests that use `.transfer()` pass
- no longer needed since we call `registerChainsAndAssets`
- no longer relies on buggy agoricNames - continues to test async-flow resumability and cross-chain vow settlement across upgrade Co-authored-by: 0xPatrick <[email protected]>
- test/bootstrapTests/orchestration.test.ts used a mixed of test and test.serial - the test without `.serial` interleaved and was confusing to debug - this mainly updates inline snapshots, which return different account and channel identifiers since all tests in this file share the same context
- basic-flows.contract.js is provided with `chainInfo` and `assetInfo` in `privateArgs` via builder options - needed for tests that use `localAccount.transfer()`, now reliant on asset info, to pass
a706d28
to
a2d491f
Compare
closes: #9966 closes: #10445 ## Description Adds multi-hop (PFM) scenarios to the `examples/send-anywhere.contract.js` multichain (e2e) test. To support this change, this PR also includes: - a proposal for registering interchain assets in vbank (closes #9966). aims for production quality but is only used in tests - a `fundFaucet` helper in `multichain-testing` so developers can request ATOM, OSMO, etc in `provisionSmartWallet` - a `GoDuration` type in `@agoric/orchestration` that captures basic Go [time duration strings](https://pkg.go.dev/time#ParseDuration) and an update to `DefaultPfmTimeoutOpts` (10min -> 10m) ### Security Considerations `@agoric/builders/scripts/testing/register-interchain-bank-assets.js` allows callers overwrite assets in `vbank` and `agoricNames`. It's only intended for testing, and shouldn't be used in production. A production version might guard against accidental overrides. ### Scaling Considerations None, mostly test code. Adds a little CI time to `multichain-testing` for the extra CoreEval. ### Documentation Considerations None ### Testing Considerations Includes an E2E to test in `multichain-testing` that leverages `register-interchain-bank-assets.js`. Also includes the first E2E test of PFM functionality added in #10584 and #10571. ### Upgrade Considerations None, library code an NPM orch or FUSDC release.
refs: #10445
Description
ChainHub.makeTransferRoute
to support PFM routing inLocalOrchAccount.transfer()
chainHub
in exo and contract testscontract-upgrade.test.ts
to no longer rely on a buggyagoricNames
chainHub
to facilitate boot and multichain testingSecurity Considerations
No new considerations from these changes.
Scaling Considerations
No new considerations from these changes.
Documentation Considerations
None
Testing Considerations
Includes unit tests. See #10584 for more robust testing of the pfm route logic. Existing
multichain-testing
will cover potential regressions (single-hop) transfers. Multi-hop tests are forthcoming.Upgrade Considerations
N/A, library code. Part of NPM Orch or FUSDC release.